package org.oschina.api.manage.module.service;

import java.util.List;

import org.oschina.Module;
import org.oschina.api.BaseService;
import org.oschina.api.manage.module.dao.ModuleDAO;
import org.oschina.api.manage.module.vo.ModuleVo;
import org.oschina.security.annotation.Require;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ModuleService extends BaseService {

	@Autowired
	private ModuleDAO moduleDAO;
	
	/**
	 * 根据类型返回
	 * @param type
	 * @return
	 */
	@Require(authorization=Module.MODULE_2)
	public List<ModuleVo> findVoByType(int type)
	{
		return _findVoByType(type);
	}
	
	/**
	 * 根据ID返回
	 * @param id
	 * @return
	 */
	public ModuleVo _findVoById(int id)
	{
		return moduleDAO._findVoById(id);
	}
	
	/**
	 * 根据类型返回
	 * @param type
	 * @return
	 */
	public List<ModuleVo> _findVoByType(int type)
	{
		return moduleDAO.findVoByType(type);
	}
}